plotrixで作図

散布図+エラーバー

library(plotrix)
x <- 1:3
y <- c(1, 3, 5)
el <- c(0.5, 0.2, 0.8)  # エラーバー下側幅
eu <- c(0.2, 0.4, 0.3)  # エラーバー上側幅
plotCI(x, y, el, eu)

plot of chunk r04a

棒グラフ+エラーバー

m <- c(10, 15, 20)
names(m) <- c("S", "M", "L")
sd <- c(2, 3, 4)
plotCI(barplot(m, col = "gray", ylim = c(0, max(m + sd))), m, sd, 
    add = TRUE)